//
//  MCRechangeVM.swift
//  MCBodyBuildingPro
//
//  Created by Renlvshijie on 2023/5/24.
//

import Foundation
import Moya


enum MCRechangeVM {
    case rechangeCode(code:String?)
}

extension MCRechangeVM:TargetType {
    
    var baseURL: URL {
        return URL.init(string: Moya_baseURL)!
    }
    
    var path: String {
        switch self {
        case .rechangeCode:
            return "api/app/user/exchange"
       
        }
    }
    var method:Moya.Method {
        switch self {
        case .rechangeCode:
            return .post
        }
    }
    
    var sampleData: Data {
        return Data()
    }
    
    
    var task: Task {
        switch self {
        case let .rechangeCode(code):
            return .requestParameters(parameters: ["code":code ?? ""], encoding: JSONEncoding.default)
       
        }
    }
    
    var headers: [String : String]? {
        return [:]
    }
    
    
}
